// pages/myself/myself.js
var app = getApp();
Page({
  /**
   * 页面的初始数据
   */
  data: {
    qq:'',
    telephone:'',
    dormitory:'',
    Number:'',
    place:'',
    sex:'',
    phone:'',
    name:'',
    college:'',
    department:'',
    img:'',
    cate_id:''
  },
  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function (options) {
    var data = app.globalData;
    // var index = options.index;
    // console.log(data,'我的信息')
    var i;
    var index;
    // console.log(data.cate_id);
    for(i=0; i<3; i++){
    // console.log(data.cate_id);
    if (data.cate_id == data.user[i].id){
        index=i;
    }
    }
    // console.log(index)
    this.setData({
      name: data.user[index].name,
      college: data.user[index].college,
      department: data.user[index].department,
      img: data.user[index].img
    });
  },
    bindFocus: function () {
    // console.log("跳转")
      wx.navigateTo({
        url: '/pages/information/information?index=' + getApp().globalData.index
    })
  }
})